﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace dIRca.Network
{
    class RegexHelper
    {
        public Regex ReplyCode
        {
            get
            {
                return new Regex("^:[^ ]+? ([0-9]{3}) .+$", RegexOptions.Compiled);
            }
        }

        public Regex Ping
        {
            get
            {
                return new Regex("^PING :.*", RegexOptions.Compiled);
            }
        }

        public Regex Error
        {
            get
            {
                return new Regex("^ERROR :.*", RegexOptions.Compiled);
            }
        }

        public Regex Action
        {
            get
            {
                return new Regex("^:.*? PRIVMSG (.).* :" + "\x1" + "ACTION .*" + "\x1" + "$", RegexOptions.Compiled);
            }
        }

        public Regex CtcpRequest
        {
            get
            {
                return new Regex("^:.*? PRIVMSG .* :" + "\x1" + ".*" + "\x1" + "$", RegexOptions.Compiled);
            }
        }

        public Regex Message
        {
            get
            {
                return new Regex("^:.*? PRIVMSG (.).* :.*$", RegexOptions.Compiled);
            }
        }

        public Regex CtcpReply
        {
            get
            {
                return new Regex("^:.*? NOTICE .* :" + "\x1" + ".*" + "\x1" + "$", RegexOptions.Compiled);
            }
        }

        public Regex Notice
        {
            get
            {
                return new Regex("^:.*? NOTICE (.).* :.*$", RegexOptions.Compiled);
            }
        }

        public Regex Invite
        {
            get
            {
                return new Regex("^:.*? INVITE .* .*$", RegexOptions.Compiled);
            }
        }

        public Regex Join
        {
            get
            {
                return new Regex("^:.*? JOIN .*$", RegexOptions.Compiled);
            }
        }

        public Regex Topic
        {
            get
            {
                return new Regex("^:.*? TOPIC .* :.*$", RegexOptions.Compiled);
            }
        }

        public Regex NickName
        {
            get
            {
                return new Regex("^:.*? NICK .*$", RegexOptions.Compiled);
            }
        }

        public Regex Kick
        {
            get
            {
                return new Regex("^:.*? KICK .* .*$", RegexOptions.Compiled);
            }
        }

        public Regex Part
        {
            get
            {
                return new Regex("^:.*? PART .*$", RegexOptions.Compiled);
            }
        }

        public Regex Mode
        {
            get
            {
                return new Regex("^:.*? MODE (.*) .*$", RegexOptions.Compiled);
            }
        }

        public Regex Quit
        {
            get
            {
                return new Regex("^:.*? QUIT :.*$", RegexOptions.Compiled);
            }
        }
    }
}
